package io.CharStream;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

// 对象操作流--序列化
public class UserStreamTest1 {
    public static void main(String[] args) throws IOException {
        User user = new User("zhangsan","123");
        //
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("a.txt"));
        oos.writeObject(user);
        oos.close();
    }
}
